Skip to content

Conversation

ayushb
Copy link
Member

@ayushb ayushb commented Sep 11, 2026

Solves #7

  • add FilterSettings model in src/models/filters.ts (type, sort, onlyFavorites)
  • store the rules in sessionStorage so they survive a reload
  • validate stored data and fall back to defaults if it is broken
  • add useFilters hook in src/controllers/ that keeps state and storage in sync
  • add tests for the model and the hook

Nothing is wired into App yet. #5 and #12 can use useFilters() from App and pass filters / setFilter down as props. If more rules are needed (e.g. generation) add them to FilterSettings and parseFilters.

* Add FilterSettings type with type, sort and favorites-only rules
* Validate stored data and fall back to defaults if it is broken
* Add useFilters hook that keeps state and session storage in sync
* Add tests for model and hook

References #7
@ayushb ayushb requested a review from a team as a code owner September 11, 2026 08:26
Copy link
Member

@thomhet thomhet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thomhet thomhet merged commit ec6ba70 into main Sep 13, 2026
@thomhet thomhet deleted the feat/filter-model branch September 13, 2026 20:39
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants